1. Field of the Invention
The present invention relates to image processing apparatuses and methods for controlling image processing apparatuses. More particularly, the present invention relates to an image processing apparatus for detecting a subject area in an image and a method for controlling such an image processing apparatus, and an image pickup apparatus.
2. Description of the Related Art
The TV-AF technique, in which an in-focus position is detected based on the sharpness (contrast) of an image signal generated using an image sensor, is widely used for autofocus detection (AF) control in camcorders and the like. Specifically, in the TV-AF technique, an AF evaluation value that indicates the degree of contrast is generated for each of image signals obtained by picking images up at different focusing lens positions, and based on the AF evaluation values, a focusing lens position that provides a highest contrast is searched for as an in-focus position.
An image pickup apparatus is known that has a function of detecting a particular subject in order to, when pickup an image of a person, stably focus on the human subject. For example, an image pickup apparatus has been proposed in which a focus detection area including a recognized face area is set for focus detection (Japanese Patent Laid-Open No. 2006-227080).
As described in Japanese Patent Laid-Open No. 2006-227080 cited supra, when focus detection is performed so that a focus detection area including a detected human face is in focus, the background may be included in the focus detection area, depending on the orientation of the detected human face, for example. In this case, if there is a high-contrast subject in the background included in the focus detection area, the background may be in focus rather than the human face as a result of focus detection.
A frame (face frame) that indicates the face area may be superimposed in order to notify the user (photographer) of the face area that is to be in focus. Similarly, in this case, the face frame may be misaligned with the human face or the size of the face frame may be altered, depending on the orientation of the human face, for example.
For example, when a person faces front as shown in FIG. 10A, the face frame and the focus detection area can be appropriately displayed and set so that almost the entirety thereof matches the face area. However, when a person faces sideways as shown in FIG. 10B, the difference in size between the left and right eyes becomes larger or the distance between the left and right eyes becomes narrower, resulting in a decrease in the accuracy of face detection. In face detection, a face area is often detected whose center is located at the eyes. Therefore, as shown in FIG. 10B, the detected face area may deviate from the actual face area, or the detected face area may be smaller than the actual face area. In particular, when the detected face area deviates from the actual face area, the displayed face frame may be misaligned with the face, and, then if the focus detection area is set to the face area, the background may have a large proportion of the focus detection area, so that the background is more likely to be in focus.